package com.sangfor.ssl.service.timeqry;

import kotlin.jvm.internal.ByteCompanionObject;
import okio.Utf8;

/* loaded from: classes2.dex */
public class TQProtocol {
    public static final int CLIENT_MSG_LENGTH = 28;
    static final int MSG_TYPE_CONN = 4;
    static final int MSG_TYPE_QRY = 3;
    static final int MSG_TYPE_QRY_EXT = 5;
    static final int MSG_TYPE_QUIT = 2;
    static final int MSG_TYPE_UPDATE = 1;
    static final int SERVER_MSG_DATA_LENGTH = 512;
    static final int SERVER_MSG_HEADER_LENGTH = 60;
    static final int SERVER_MSG_LENGTH = 604;
    static final int SERVER_MSG_PADDING_LENGTH = 32;
    private static byte[] TIMEQUERY_FIXHEADER_V3 = {22, 3, 1, 0, 77, 1, 0, 0, 73, 3, 1, 70, -125, 116, 36, 1, 67, 22, 41, 31, -107, 62, -55, 99, -71, -4, -74, 22, 0, -86, 32, 21, -21, 117, 7, 89, 64, -117, -115, 12, -31, 96, 51, 32, -79, 101, -10, ByteCompanionObject.MAX_VALUE, 90, 109, 44, 84, -46, 113, 105, -105, 114, 88, 101, -61, 64, -102, -118, 15, -51, -127, -40, 46, -37, 123, -113, -9, 27, -63, ByteCompanionObject.MIN_VALUE, -58, 0, 2, 0, 57, 1, 0};
    private static byte[] SERVER_FIXHEADER_V3 = {22, 3, 1, 0, 74, 2, 0, 0, 70, 3, 1, 69, 51, Utf8.REPLACEMENT_BYTE, -42, 9, -39, -2, -41, 11, -94, -99, 17, 103, -58, 104, 23, -44, 3, -59, -105, 26, -60, 109, 44, 108, 112, 89, 23, 42, 114, 82, -38, 32, -79, 101, -10, ByteCompanionObject.MAX_VALUE, 90, 109, 44, 84, -46, 113, 105, -105, 114, 88, 101, -61, 64, -102, -118, 15, -51, -127, -40, 46, -37, 123, -113, -9, 27, -63, ByteCompanionObject.MIN_VALUE, -58, 0, 4, 0, 20, 3, 1, 0, 1, 1, 22, 3, 1, 0, 32, -115, -122, 76, -48, 73, -7, -122, 56, -19, 51, -64, 58, -81, 80, -79, -61, 30, 15, 59, 61, -56, -29, 61, 36, -20, 103, -57, -73, -73, 102, -32, ByteCompanionObject.MAX_VALUE};
    private static byte[] CLIENT_ACK_V3 = {20, 3, 1, 0, 1, 1, 22, 3, 1, 0, 32, 43, -47, -33, 14, -30, 76, -38, 122, 54, 14, -34, 36, -127, -71, 121, 50, 103, -113, -14, -120, -116, -17, -93, 126, 80, 28, 9, 107, 9, -100, 90, 13};

    /* loaded from: classes2.dex */
    public enum AckMessageType {
        ACK_QUERY(1),
        ACK_UPDATE(2),
        ACK_SHUTDOWN(3),
        ACK_NEWSESSION(4),
        ACK_CONNEC(5),
        ACK_QUERY_EXT(6);
        
        private int m_value;

        AckMessageType(int i) {
            this.m_value = i;
        }

        public int intValue() {
            return this.m_value;
        }

        public static AckMessageType valueOf(int i) {
            switch (i) {
                case 1:
                    return ACK_QUERY;
                case 2:
                    return ACK_UPDATE;
                case 3:
                    return ACK_SHUTDOWN;
                case 4:
                    return ACK_NEWSESSION;
                case 5:
                    return ACK_CONNEC;
                case 6:
                    return ACK_QUERY_EXT;
                default:
                    throw new IllegalArgumentException("Invalid AckMessageType. Value is " + i);
            }
        }
    }

    public static byte[] fetchServerFixHeaderV3() {
        return SERVER_FIXHEADER_V3;
    }

    public static byte[] fetchClientAckV3() {
        return CLIENT_ACK_V3;
    }

    public static byte[] fetchHandshakeReqV3(byte[] bArr) {
        System.arraycopy(bArr, 0, TIMEQUERY_FIXHEADER_V3, 44, bArr.length);
        return TIMEQUERY_FIXHEADER_V3;
    }
}
